package net.lab1024.sa.admin.module.business.roland.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.lab1024.sa.admin.module.business.roland.domain.entity.RolandOrderEntity;
import net.lab1024.sa.admin.module.business.roland.domain.entity.RolandSeaEntity;
import net.lab1024.sa.admin.module.business.roland.domain.form.RolandOrderQueryForm;
import net.lab1024.sa.admin.module.business.roland.domain.vo.RolandOrderDetailVO;
import net.lab1024.sa.admin.module.business.roland.domain.vo.RolandOrderExcelVO;
import net.lab1024.sa.admin.module.business.roland.domain.vo.RolandOrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 客户订单表 Dao
 *
 * @Author dragon
 * @Date 2023-12-11 13:27:12
 * @Copyright dragon
 */

@Mapper
@Component
public interface RolandOrderDao extends BaseMapper<RolandOrderEntity> {

    /**
     * 分页 查询
     *
     * @param page
     * @param queryForm
     * @return
     */
    List<RolandOrderVO> queryPage(Page page, @Param("queryForm") RolandOrderQueryForm queryForm);

    /**
     * 订单详情
     *
     * @param id 订单 id
     * @return 订单详情
     */
    List<RolandOrderDetailVO> selectDetail(@Param("id") Integer id);

    List<RolandSeaEntity> selectOrderSeatsBySeatId(@Param("seatIds") List<Integer> seatIds);

    int selectSeatNum(@Param("orderIds") List<Integer> orderIds);

    void saveDetail(@Param("orderId") Integer orderId, @Param("seatIds") List<Integer> seatIds);

    List<Integer> selectOrderSeats();

    List<RolandOrderVO> selectCustomerOrders(@Param("studentName") String studentName, @Param("phone") String phone);

    List<RolandOrderExcelVO> selectByParam(@Param("queryForm") RolandOrderQueryForm queryForm);

    void deleteDetailByOrderIds(@Param("orderIds") List<Integer> orderIds);

    void deleteDetailByOrderId(@Param("orderId") Integer orderId);

    List<RolandOrderDetailVO> selectOrderDetailByOrderId(@Param("orderIds") List<Integer> orderIds);
}
